package controller

import (
	"github.com/gin-gonic/gin"
)

type Controller struct {
}

func (c *Controller) ToJSON(ctx *gin.Context, code int, msg string, data interface{}) {
	ctx.JSON(code, map[string]interface{}{"code": code, "msg": msg, "data": data})
	ctx.Abort()
}
